home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / Processes.h < prev    next >
Text File  |  1995-07-06  |  6KB  |  194 lines

  1. /*
  2.      File:        Processes.h
  3.  
  4.      Contains:    Process Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __PROCESSES__
  21. #define __PROCESSES__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __EVENTS__
  30. #include <Events.h>
  31. #endif
  32. /*    #include <Quickdraw.h>                                        */
  33. /*        #include <MixedMode.h>                                    */
  34. /*        #include <QuickdrawText.h>                                */
  35. /*    #include <OSUtils.h>                                        */
  36. /*        #include <Memory.h>                                        */
  37.  
  38. #ifndef __FILES__
  39. #include <Files.h>
  40. #endif
  41. /*    #include <Finder.h>                                            */
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_ALIGN_SUPPORTED
  48. #pragma options align=mac68k
  49. #endif
  50.  
  51. #if PRAGMA_IMPORT_SUPPORTED
  52. #pragma import on
  53. #endif
  54.  
  55. struct ProcessSerialNumber {
  56.     unsigned long                    highLongOfPSN;
  57.     unsigned long                    lowLongOfPSN;
  58. };
  59. typedef struct ProcessSerialNumber ProcessSerialNumber, *ProcessSerialNumberPtr;
  60.  
  61.  
  62. enum {
  63. /* Process identifier - Various reserved process serial numbers */
  64.     kNoProcess                    = 0,
  65.     kSystemProcess                = 1,
  66.     kCurrentProcess                = 2
  67. };
  68.  
  69. /* Definition of the parameter block passed to _Launch
  70.     Typedef and flags for launchControlFlags field */
  71. typedef unsigned short LaunchFlags;
  72.  
  73.  
  74. enum {
  75. /* Definition of the parameter block passed to _Launch */
  76.     launchContinue                = 0x4000,
  77.     launchNoFileFlags            = 0x0800,
  78.     launchUseMinimum            = 0x0400,
  79.     launchDontSwitch            = 0x0200,
  80.     launchAllow24Bit            = 0x0100,
  81.     launchInhibitDaemon            = 0x0080
  82. };
  83.  
  84. /* Format for first AppleEvent to pass to new process.  The size of the overall
  85.   buffer variable: the message body immediately follows the messageLength */
  86. struct AppParameters {
  87.     EventRecord                        theMsgEvent;
  88.     unsigned long                    eventRefCon;
  89.     unsigned long                    messageLength;
  90. };
  91. typedef struct AppParameters AppParameters, *AppParametersPtr;
  92.  
  93. /* Parameter block to _Launch */
  94. struct LaunchParamBlockRec {
  95.     unsigned long                    reserved1;
  96.     unsigned short                    reserved2;
  97.     unsigned short                    launchBlockID;
  98.     unsigned long                    launchEPBLength;
  99.     unsigned short                    launchFileFlags;
  100.     LaunchFlags                        launchControlFlags;
  101.     FSSpecPtr                        launchAppSpec;
  102.     ProcessSerialNumber                launchProcessSN;
  103.     unsigned long                    launchPreferredSize;
  104.     unsigned long                    launchMinimumSize;
  105.     unsigned long                    launchAvailableSize;
  106.     AppParametersPtr                launchAppParameters;
  107. };
  108. typedef struct LaunchParamBlockRec LaunchParamBlockRec, *LaunchPBPtr;
  109.  
  110. /* Set launchBlockID to extendedBlock to specify that extensions exist.
  111.  Set launchEPBLength to extendedBlockLen for compatibility.*/
  112.  
  113. enum {
  114.     extendedBlock                = ((unsigned)'LC'),
  115.     extendedBlockLen            = (sizeof(LaunchParamBlockRec) - 12)
  116. };
  117.  
  118. enum {
  119. /* Definition of the information block returned by GetProcessInformation */
  120.     modeDeskAccessory            = 0x00020000,
  121.     modeMultiLaunch                = 0x00010000,
  122.     modeNeedSuspendResume        = 0x00004000,
  123.     modeCanBackground            = 0x00001000,
  124.     modeDoesActivateOnFGSwitch    = 0x00000800,
  125.     modeOnlyBackground            = 0x00000400,
  126.     modeGetFrontClicks            = 0x00000200,
  127.     modeGetAppDiedMsg            = 0x00000100,
  128.     mode32BitCompatible            = 0x00000080,
  129.     modeHighLevelEventAware        = 0x00000040,
  130.     modeLocalAndRemoteHLEvents    = 0x00000020,
  131.     modeStationeryAware            = 0x00000010,
  132.     modeUseTextEditServices        = 0x00000008,
  133.     modeDisplayManagerAware        = 0x00000004
  134. };
  135.  
  136. /* Record returned by GetProcessInformation */
  137. struct ProcessInfoRec {
  138.     unsigned long                    processInfoLength;
  139.     StringPtr                        processName;
  140.     ProcessSerialNumber                processNumber;
  141.     unsigned long                    processType;
  142.     OSType                            processSignature;
  143.     unsigned long                    processMode;
  144.     Ptr                                processLocation;
  145.     unsigned long                    processSize;
  146.     unsigned long                    processFreeMem;
  147.     ProcessSerialNumber                processLauncher;
  148.     unsigned long                    processLaunchDate;
  149.     unsigned long                    processActiveTime;
  150.     FSSpecPtr                        processAppSpec;
  151. };
  152. typedef struct ProcessInfoRec ProcessInfoRec, *ProcessInfoRecPtr;
  153.  
  154.  
  155. #if !GENERATINGCFM
  156. #pragma parameter __D0 LaunchApplication(__A0)
  157. #endif
  158. extern pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
  159.  ONEWORDINLINE(0xA9F2);
  160. extern pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  161.  THREEWORDINLINE(0x3F3C, 0x0036, 0xA88F);
  162. extern pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  163.  THREEWORDINLINE(0x3F3C, 0x0037, 0xA88F);
  164. extern pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  165.  FIVEWORDINLINE(0x70FF, 0x2F00, 0x3F3C, 0x0039, 0xA88F);
  166. extern pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  167.  THREEWORDINLINE(0x3F3C, 0x0038, 0xA88F);
  168. extern pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
  169.  THREEWORDINLINE(0x3F3C, 0x003A, 0xA88F);
  170. extern pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  171.  THREEWORDINLINE(0x3F3C, 0x003B, 0xA88F);
  172. extern pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  173.  THREEWORDINLINE(0x3F3C, 0x003C, 0xA88F);
  174. extern pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  175.  THREEWORDINLINE(0x3F3C, 0x003D, 0xA88F);
  176. #if !OLDROUTINELOCATIONS
  177. extern pascal void ExitToShell(void)
  178.  ONEWORDINLINE(0xA9F4);
  179. #endif
  180.  
  181. #if PRAGMA_IMPORT_SUPPORTED
  182. #pragma import off
  183. #endif
  184.  
  185. #if PRAGMA_ALIGN_SUPPORTED
  186. #pragma options align=reset
  187. #endif
  188.  
  189. #ifdef __cplusplus
  190. }
  191. #endif
  192.  
  193. #endif /* __PROCESSES__ */
  194.